// 处理用户登录逻辑
const db = require("../lib/db")

function updateArticle(title,content,authorId){
    console.log(title,content,authorId)
    return new Promise((resolve,reject)=>{
        let sql = `update updateArticle set title='${title}',content = '${content}'where authorId = '${authorId}'`;
        // console.log(sql)
        db.querySql(sql).then(data=>{
            console.log(data)
            if(data.length == 0){
                resolve(501)
            }else{
                resolve(200)
            }
        })
    })
    
}

// 导出
module.exports = updateArticle;